﻿USE [BizBloxTest]
GO
/****** Object:  User [cinj]    Script Date: 02/11/2009 12:58:30 ******/
CREATE USER [cinj] FOR LOGIN [HQ\cinj] WITH DEFAULT_SCHEMA=[cinj]
GO
/****** Object:  Schema [cinj]    Script Date: 02/11/2009 12:58:30 ******/
CREATE SCHEMA [cinj] AUTHORIZATION [cinj]
GO
/****** Object:  Table [dbo].[Food]    Script Date: 02/11/2009 12:58:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Food](
	[FoodID] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[Price] [float] NULL,
 CONSTRAINT [PK_Food] PRIMARY KEY CLUSTERED 
(
	[FoodID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Student]    Script Date: 02/11/2009 12:58:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Student](
	[StudentID] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
	[Name] [varchar](256) NOT NULL,
	[Email] [varchar](256) NOT NULL,
	[Age] [int] NULL,
 CONSTRAINT [PK_Student] PRIMARY KEY CLUSTERED 
(
	[StudentID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[LunchOrder]    Script Date: 02/11/2009 12:58:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[LunchOrder](
	[LunchOrderID] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
	[StudentID] [uniqueidentifier] NOT NULL,
	[FoodID] [uniqueidentifier] NULL,
	[dt_OrderDate] [varchar](50) NULL,
	[Quantity] [int] NULL,
 CONSTRAINT [PK_LunchORder] PRIMARY KEY CLUSTERED 
(
	[LunchOrderID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[CandyBar]    Script Date: 02/11/2009 12:58:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[CandyBar](
	[Brand] [varchar](50) NULL,
	[FoodID] [uniqueidentifier] NOT NULL,
	[Counter] [int] IDENTITY(1,1) NOT NULL,
	[SomeMoney] [money] NULL,
	[SomeReal] [real] NULL,
	[SomeSmallInt] [smallint] NULL,
	[SomeSmallMoney] [smallmoney] NULL,
	[SomeBigInt] [bigint] NULL,
	[SomeTinyInt] [tinyint] NULL,
 CONSTRAINT [PK_CandyBar] PRIMARY KEY CLUSTERED 
(
	[FoodID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  ForeignKey [FK_CandyBar_Food]    Script Date: 02/11/2009 12:58:30 ******/
ALTER TABLE [dbo].[CandyBar]  WITH NOCHECK ADD  CONSTRAINT [FK_CandyBar_Food] FOREIGN KEY([FoodID])
REFERENCES [dbo].[Food] ([FoodID])
GO
ALTER TABLE [dbo].[CandyBar] CHECK CONSTRAINT [FK_CandyBar_Food]
GO
/****** Object:  ForeignKey [FK_LunchOrder_Food]    Script Date: 02/11/2009 12:58:30 ******/
ALTER TABLE [dbo].[LunchOrder]  WITH NOCHECK ADD  CONSTRAINT [FK_LunchOrder_Food] FOREIGN KEY([FoodID])
REFERENCES [dbo].[Food] ([FoodID])
GO
ALTER TABLE [dbo].[LunchOrder] NOCHECK CONSTRAINT [FK_LunchOrder_Food]
GO
/****** Object:  ForeignKey [FK_LunchOrder_Student]    Script Date: 02/11/2009 12:58:30 ******/
ALTER TABLE [dbo].[LunchOrder]  WITH NOCHECK ADD  CONSTRAINT [FK_LunchOrder_Student] FOREIGN KEY([StudentID])
REFERENCES [dbo].[Student] ([StudentID])
GO
ALTER TABLE [dbo].[LunchOrder] NOCHECK CONSTRAINT [FK_LunchOrder_Student]
GO
